import java.util.concurrent.TimeUnit;

/**
 * @author: Chenwujie
 * @date: 2021-03-30 16:04
 */
public class FinalTest {
    private final int value;
    public static FinalTest obj;

    public FinalTest(int value) {
        obj = this;
        try {
            TimeUnit.MILLISECONDS.sleep(200);
        } catch (InterruptedException e) {
            e.printStackTrace();
        }
        this.value = value;
    }

    public static void main(String[] args) {
        Thread thread = new Thread(new Runnable() {
            @Override
            public void run() {
                if (FinalTest.obj != null) {
                    System.out.println(obj.value);
                }
            }
        });
        thread.start();
        FinalTest finalTest = new FinalTest(1);
        System.out.println("end");
    }
}
